<template>

  <el-container>
    <el-header class="lyq2">
        <el-form :model="form" ref="form">
<!--            <el-form-item>-->
<!--            <div class="put">-->
<!--            <div class="shounum">-->
<!--            <label class="my-label">手牌号:</label>-->
<!--            <el-input v-model="form.handBrand" style="width: 73%" ref="myInputse" ></el-input>-->

<!--            </div>-->
<!--&lt;!&ndash;            <div class="yuannum">&ndash;&gt;-->
<!--&lt;!&ndash;            <label class="my-label">员工号:</label>&ndash;&gt;-->
<!--&lt;!&ndash;            <el-input v-model="this.$route.query.NUM" ref="myInputses" class="yuan"></el-input>&ndash;&gt;-->
<!--&lt;!&ndash;            </div>&ndash;&gt;-->
<!--            </div>-->
<!--            </el-form-item>-->
          <el-form-item>
            <div class="anniu">
            <div class="luru">
            <el-button class="query" type="danger" plain @click="ceshi">录入</el-button>
            </div>
            <div class="diandan">
            <el-button class="query1" type="primary" plain @click="handleUpdate2">点单</el-button>
            </div>
            <div class="hujiao">
            <el-button class="call" type="success" plain @click="handleUpdate">呼叫</el-button>
            <el-button class="call" type="success" plain @click="handleUpdater">专呼</el-button>
            </div>
            </div>
            <el-divider></el-divider>
          </el-form-item>
        </el-form>
<!--       点单对话框-->
<!--      <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="opener" width="1500px" append-to-body>-->
<!--        <div class="tanchu">-->
<!--          <div class="tou">-->
<!--        <el-form ref="form" :model="form" :rules="rules" label-width="100px">-->
<!--          <el-form-item>-->
<!--&lt;!&ndash;            <label class="my-label">手牌号:</label>&ndash;&gt;-->
<!--&lt;!&ndash;            <el-input v-model="form.handBrand" class="gebo" ></el-input>&ndash;&gt;-->
<!--            <div class="put0">-->
<!--              <Verifydiandan class="diandan1" v-model="form.handBrand" placeholder="请输入手牌号" @comfirm="you"></Verifydiandan>-->
<!--            </div>-->
<!--          </el-form-item>-->
<!--        </el-form>-->
<!--          </div>-->
<!--        <div slot="footer" class="jiao" style="height: 30px">-->
<!--          <el-button @click="submitForm" type="primary" plain class="queding">确 定</el-button>-->
<!--          <el-button @click="canceler" type="primary" plain class="quxiao">取 消</el-button>-->
<!--        </div>-->
<!--        </div>-->
      <el-dialog :visible.sync="opener"   width="80%"  :showClose="false"    center>
        <el-card class="lyqcard">
          <div class="el-dialog-div">
            <Verifydiandan @comfirm="you" :inputName="this.handbrandnumber"></Verifydiandan>
          </div >
        </el-card>
      </el-dialog>
      <!--       删除对话框-->
      <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openfr" width="50%" append-to-body>
        <div class="tanchu">
          <div class="tou">
            <el-form ref="form" :model="form" :rules="rules" label-width="100px">
              <div class="woxiangjuzhong">
              <el-form-item>
                <label class="my-label">是否确认删除此条记录</label>
              </el-form-item>
              </div>
            </el-form>
          </div>
          <div slot="footer" class="jiao" style="height: 30px">
            <el-button @click="submitFormfr" type="primary" plain class="queding2">确 定</el-button>
            <el-button @click="cancelfr" type="primary" plain class="quxiao2">取 消</el-button>
          </div>
        </div>
      </el-dialog>

      <!--       专呼对话框-->
<!--      <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="opentd" width="1500px" append-to-body>-->
<!--                      <el-form ref="form3" :model="form3" :rules="rules" label-width="100px">-->
<!--                        <el-form-item>-->
<!--                          <div class="put2">-->
      <el-dialog :visible.sync="opentd"   width="80%"  :showClose="false"    center>
                              <el-card class="lyqcard">
                                <div class="el-dialog-div">
                                  <Verifypaihao @comfirm="hao" :inputName="this.handbrandnumber"></Verifypaihao>
                                </div >
                              </el-card>

<!--                            <Verifypaihao class="zhuanhu" v-model="form3.userId" placeholder="请输入员工号" @comfirm="hao"></Verifypaihao>-->
<!--                          </div>-->
<!--                        </el-form-item>-->
<!--                      </el-form>-->
      </el-dialog>

      <!-- 录入对话框 -->
<!--      <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="1500px" append-to-body>-->
      <el-dialog :visible.sync="open"   width="84%"  :showClose="false"    center>
        <div class="tiaoweizhi">
        <el-card class="lyqcard">
      <el-form label-position="right" ref="form" :model="form"  :rules="rules"  label-width="120px">
          <div class="put3">
          <el-container>
            <div style="height: 100px">
              <el-main>
                <el-form-item>
                  <div class="put1">
                    <Verifyluru class="luru1" v-model="form.handBrand" placeholder="请输入手牌号" @comfirm="hao123"></Verifyluru>
                  </div>
                </el-form-item>
              </el-main>
            </div>
          </el-container>

            <el-container>
            <div class="leixing">
              <el-main>
                  <el-form-item >
                    <div class="ai-tab-change">
<!--                    <el-radio-group v-model="form.note1" size="medium" class="aaa">-->
<!--&lt;!&ndash;                      <el-radio-button label="0" >快 排</el-radio-button>&ndash;&gt;-->
<!--                      <el-radio-button label="1" >专 人</el-radio-button>-->
<!--                    </el-radio-group>-->
                      <el-button v-on:click="toggleValue" class="zhuanhuanniu">专 呼</el-button>
                    </div>
                  </el-form-item>
              </el-main>
            </div>
          </el-container>
          <el-container>
            <div id="1" style="height: 95px;width: 100%" v-if="form.note1 == '1'" >
              <el-main>
                <el-form-item>
                  <div class="put">
                    <el-row
                      class="button-list"
                      v-for="rows in branchData">
                      <el-col v-for="cols in rows" :span="6">
                        <el-button plain style="height: 120px;width: 200px;margin-top: 3px;padding: 0;"
                                   type="primary"
                                   class="button1"
                                   @click="handleAddgong(cols.id)">
                          <div>{{cols.userName}}</div>
                        </el-button>
                      </el-col>
                    </el-row>
                    <div class="fanye">
                    <el-button @click.prevent.stop.native="shangyiye" type="primary" plain class="shangyiye">上一页</el-button>
                      <br>
                    <el-button @click.prevent.stop.native="xiayiye" type="primary" plain class="xiayiye">下一页</el-button>
                    </div>
                  </div>
                  </el-form-item>
              </el-main>
            </div>
          </el-container>
          </div>
        </el-form>
        <div style="height: 60px;width: 100%">
<!--          <el-button type="primary" @click="handleAdd" class="queding1">确 定</el-button>-->
<!--          <el-button @click="cancel" class="quxiao1">取 消</el-button>-->
        </div>
        </el-card>
        </div>
      </el-dialog>
    </el-header>

    <el-main>
      <div class="app-container">
        <div class="big_box">

            <div class="zuo_box">
              <h1 align="center" class="left"> 排队中</h1>
              <el-divider></el-divider>
              <el-table :data="numberList1" :header-cell-style="{textAlign:'center',fontSize: '24px'}"
                        :cell-style="{textAlign: 'center'}" height="635" class="ddd" stripe>
                <template slot="empty">
                  玉泉宫
                </template>
                <el-table-column label="序号" align="center" prop="index" width="70">
                  <template slot-scope="scope">
                    <div @dblclick="dcancel(scope.row.id)">{{ scope.row.index }}</div>
                  </template>
                </el-table-column>
                <el-table-column  label="手牌" align="center" prop="handBrand" width="130">
                  <template slot-scope="scope">
                    <div @dblclick="dcancel(scope.row.id)">{{ scope.row.handBrand }}</div>
                  </template>
                </el-table-column>
                <el-table-column  label="时间" align="center" prop="startNumberingTime">
                  <template slot-scope="scope">
                    <div @dblclick="dcancel(scope.row.id)">{{ scope.row.startNumberingTime }}</div>
                  </template>
                </el-table-column>
                <el-table-column  label="工号" align="center" prop="nextGuest">
                  <template slot-scope="scope">
                    <div @dblclick="dcancel(scope.row.id)">{{ scope.row.nextGuest }}</div>
                  </template>
                </el-table-column>

              </el-table>
            </div>

            <div class="zhong_box">
              <h1 align="center" class="center"> 服务中</h1>
              <el-divider></el-divider>
              <el-table :data="numberList2" :header-cell-style="{textAlign:'center',fontSize: '24px'}"
                        :cell-style="{textAlign: 'center'}" height="635" class="ddd" stripe>
                <template slot="empty">
                  玉泉宫
                </template>
                <el-table-column label="序号" align="center" prop="index" width="70">
                  <template slot-scope="scope">
                    <div @dblclick="dcancel(scope.row.id)">{{ scope.row.index }}</div>
                  </template>
                </el-table-column>
                <el-table-column  label="手牌" align="center" prop="handBrand" width="130">
                  <template slot-scope="scope">
                    <div @dblclick="dcancel(scope.row.id)">{{ scope.row.handBrand }}</div>
                  </template>
                </el-table-column>
                <el-table-column  label="时间" align="center" prop="startNumberingTime">
                  <template slot-scope="scope">
                    <div @dblclick="dcancel(scope.row.id)">{{ scope.row.startNumberingTime }}</div>
                  </template>
                </el-table-column>
                <el-table-column  label="工号" align="center" prop="nextGuest">
                  <template slot-scope="scope">
                    <div @dblclick="dcancel(scope.row.id)">{{ scope.row.nextGuest }}</div>
                  </template>
                </el-table-column>

              </el-table>
            </div>

          <div class="you_box">
              <h1 align="center"  class="right">呼叫</h1>
              <el-divider></el-divider>

<!--              <el-form :model="form2" ref="form2" class="bbb">-->
<!--                <el-form-item>-->
<!--                    <label class="my-label">待呼叫的客人</label>-->
<!--                  <br/>-->
<!--                  <br/>-->
<!--                  <el-input v-model="form2.dangqian" style="width: 30%" ref="myInputs" class="no-border"></el-input>-->
<!--                </el-form-item>-->
<!--              </el-form>-->

              <el-form :model="form1" ref="form1" class="bbb">
                <el-form-item>
                    <label class="my-label">待呼叫的客人</label>
                  <br/>
                  <br/>
                  <el-input v-model="form1.xiayige" style="width: 100px" ref="myInput0" class="no-border"></el-input>
                  <br/>
                  <br/>
                  <el-input v-model="form1.xiayige1" style="width: 100px" ref="myInput1" class="no-border"></el-input>
                  <br/>
                  <br/>
                  <el-input v-model="form1.xiayige2" style="width: 100px" ref="myInput2" class="no-border"></el-input>
                  <br/>
                  <br/>
                  <el-input v-model="form1.xiayige3" style="width: 100px" ref="myInput3" class="no-border"></el-input>
                  <br/>
                  <br/>
                  <br/>
                </el-form-item>
              </el-form>

          </div>
        </div>
      </div>
    </el-main>
  </el-container>



</template>

<script>

import { listNumber, getNumber, delNumber, addNumber, updateNumber } from "@/api/module/lyq/number";
import { listHands, getHands, delHands, addHands, updateHands } from "@/api/module/lyq/hands";
import {getBaseinfo, listBaseinfo} from "@/api/module/lyq/baseinfo";
import {listBills} from "@/api/module/lyq/bills";
import Verifypaihao from "./Verifypaihao.vue";
import Verifyluru from "./Verifyluru.vue";
import Verifydiandan from "./Verifydiandan.vue";

// import "./App.css";
import SimpleKeyboard from "@/views/module/lyq/cuozao/SimpleKeyboard";
import {qubing} from "@/api/module/ljw/bingpai";
import {getProject, listProject} from "@/api/module/lyq/project";
export default {
  name: "Project",
  components: {
    SimpleKeyboard,
    Verifypaihao,
    Verifyluru,
    Verifydiandan
  },
  dicts: ['yqg_project_category'],
  inject:['reload'],
  data() {
    return {
      centerDialogVisible: false,
      inputValue: '',
      value: '1',
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      update: null,
      // 项目信息表格数据
      projectList: [],
      handsList:[],
      billsList:[],
      options:[],
      // 搓澡排号表格数据
      numberList1: [],
      numberList2: [],
      numberList3: [],
      numberList4: [],
      numberList5: [],
      numberList6: [],
      numberList7: [],
      baseinfonumberList: [],
      branchData:[],
      goodsList:[],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      opener: false,
      opentd: false,
      openfr: false,
      // 查询参数
      queryParams:{
        pageNum: 1,
        pageSize: 10,
        handBrand: null,
        startNumberingTime: null,
        currentGuest: null,
        nextGuest: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null
      },
      // list3查询参数
      queryParams33:{
        pageNum: 1,
        pageSize: 10,
        handBrand: null,
        startNumberingTime: null,
        currentGuest: null,
        nextGuest: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null
      },
      // 查询参数
      delqueryParams:{
        pageNum: 1,
        pageSize: 10,
        handBrand: null,
        startNumberingTime: null,
        currentGuest: null,
        nextGuest: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null
      },
      // 查询参数
      queryParams1:{
        pageNum: 1,
        pageSize: 10,
        handBrand: null,
        startNumberingTime: null,
        currentGuest: null,
        nextGuest: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null
      },
      // 员工查询参数
      baseinfoqueryParams: {
        pageNum: 1,
        pageSize: 4,
        userId: null,
        deptId: null,
        nickName: null,
        userName: null,
        idNumber: null,
        sex: null,
        phone: null,
        post: null,
        department: null,
        personnelStatus: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null
      },
      // 手牌查询参数
      handqueryParams:{
        pageNum: 1,
        pageSize: 10,
        handBrand: null,
        handCategory: null,
        handState: null,
        lockedState: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null
      },
      billqueryParams: {
        pageNum: 1,
        pageSize: 10,
        userId: null,
        deptId: null,
        nickName: null,
        department: null,
        userName: null,
        post: null,
        handBrand: null,
        originalHand: null,
        handCategory: null,
        retentionStatus: null,
        mergeStatus: null,
        handState: null,
        numberOfPeople: null,
        allCost: null,
        openingTime: null,
        groupId: null,
        oddNumbers: null,
        children: null,
        mastercard: null,
        handoverTime: null,
        handoverStatus: null,
        barNumber: null,
        sailings: null,
        together: null,
        note: null,
        groupNotes: null,
        discountAmount: null,
        checkoutTime: null,
        supplementaryConsumption: null,
        paidInAmount: null,
        paidInCash: null,
        changeAmount: null,
        paymentMethod: null,
        totalConsumptionAmount: null,
        cardiner: null,
        checkout: null,
        frontSign: null,
        frontPrintTime: null,
        operator: null,
        checkoutLocation: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },
      // 表单参数
      form: {
        note1:'0',
        nextGuest:'无'
      },
      form1: {
        xiayige:null,
        xiayige1:null,
        xiayige2:null,
        xiayige3:null
      },
      form2: {},
      form3: {},
      form4: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.shanchu();
    this.getList1();
    this.getList2();
    this.getList3();
    this.getusername();
    this.centerDialogVisible=false;

  },
  mounted() {
    this.$refs.myInput0.$refs.input.style.fontSize = "32px";
    this.$refs.myInput1.$refs.input.style.fontSize = "32px";
    this.$refs.myInput2.$refs.input.style.fontSize = "32px";
    this.$refs.myInput3.$refs.input.style.fontSize = "32px";
    this.$refs.myInputs.$refs.input.style.fontSize = "32px";
    this.$refs.myInputse.$refs.input.style.fontSize = "32px";
    this.$refs.myInputses.$refs.input.style.fontSize = "32px";
  },
  methods: {
    toggleValue() {
      this.form.note1 = this.form.note1 === '1' ? '0' : '1';
    },
    hao(k){
      this.form3.userId=k;
      this.zhuanhude();
      this.opentd=false;
      this.centerDialogVisible=false;
    },
    hao123(b){
      this.form.handBrand=b;
      this.handleAdd();

    },
    you(c){
      this.form.handBrand=c;
      this.submitForm();
      this.centerDialogVisible=false;
    },

    /** 查询搓澡排队中列表 */
    getList1() {
      this.loading = true;
      this.queryParams.nextGuest=null;
      this.queryParams.note1=null;
      this.queryParams.currentGuest=0;
      listNumber(this.queryParams).then(response => {
        this.numberList1 = response.rows;
        this.total = response.total;
        // if(this.numberList1.length==0)
        // {
        //   this.form1.xiayige='';
        // }
        // else {
        //   this.form1.xiayige=this.numberList1[0].handBrand;
        // }
        for (var i=1;i<=this.numberList1.length;i++)
        {
          this.numberList1[i-1].index=i;
        }
        for (var i=0;i<=this.numberList1.length;i++)
        {
          this.numberList1[i].startNumberingTime=this.numberList1[i].startNumberingTime.slice(11)
        }
        this.loading = false;
      });
    },
    /** 查询搓澡服务中列表 */
    getList2() {
      this.loading = true;
      this.queryParams.nextGuest=null;
      this.queryParams.note1=null;
      this.queryParams.currentGuest=1;
      listNumber(this.queryParams).then(response => {
        this.numberList2 = response.rows;

        this.total = response.total;
        // if(this.numberList2.length==0)
        // {
        //   this.form2.dangqian='';
        // }
        // else {
        //   this.form2.dangqian= this.numberList2[0].handBrand;
        // }
        for (var i=1;i<=this.numberList2.length;i++)
        {
          this.numberList2[i-1].index=i;
        }
        for (var i=0;i<=this.numberList2.length;i++)
        {
          this.numberList2[i].startNumberingTime=this.numberList2[i].startNumberingTime.slice(11)
        }
        this.loading = false;
      });
    },
    /** 查询搓澡排号中列表 */
    getList3() {

      this.queryParams.nextGuest="无";
      this.queryParams.note1=0;
      this.queryParams.currentGuest=0;
      listNumber(this.queryParams).then(response => {
        this.numberList6 = response.rows;
        this.total = response.total;
        if(this.numberList6.length==0)
        {
          this.form1.xiayige='';
        }
        else {
          this.form1.xiayige= this.numberList6[0].handBrand;
        }

        this.queryParams33.currentGuest=0;
        listNumber(this.queryParams33).then(response => {
          this.numberList7 = response.rows;
          if(this.numberList7.length==0)
          {

            this.form1.xiayige1='';
            this.form1.xiayige2='';
            this.form1.xiayige3='';
          }
          else {
            if (this.numberList7[0].note1==0)
            {
              this.form1.xiayige1='';
              this.form1.xiayige2='';
              this.form1.xiayige3='';
            }
            else {
              this.form1.xiayige1= this.numberList7[0].handBrand;
              if (this.numberList7[1].note1==0)
              {
                this.form1.xiayige2='';
                this.form1.xiayige3='';
                console.log(this.form1.xiayige+this.form1.xiayige1+this.form1.xiayige2+this.form1.xiayige3)
              }
              else {
                this.form1.xiayige2= this.numberList7[1].handBrand;
                if (this.numberList7[2].note1==0)
                {
                  this.form1.xiayige3='';
                }
                else {
                  this.form1.xiayige3= this.numberList7[2].handBrand;

                }
              }
            }

          }

        });

      });
    },
    getusername(){
      this.baseinfoqueryParams.department=0;
      listBaseinfo(this.baseinfoqueryParams).then(response => {
        this.baseinfonumberList = response.rows;
        // this.options=this.baseinfonumberList;
        console.log("aaaa"+this.baseinfonumberList[0].userName)
        this.getRow();
      });
    },
    handclose(){
      this.$options.created[0].call(this);
    },
    //取消
    cancel() {
      this.form.note1=0;
      this.form.handBrand=null;
      console.log("123456"+this.form.handBrand)
      this.form.nextGuest='无';
      this.open = false;
    },
    //取消
    dcancel(id){
      this.update=id;
      console.log("123"+id);
      this.openfr=true;
        // this.queryParams.beforeLeave = number
        // qubing(this.queryParams).then(res => {
        //   this.$modal.msgSuccess(number + "取并成功");
        //   // location.reload()
        //   // this.getList()
        //   // this.reload()
        //   this.submit()
        // })

    },
    //取消
    canceler() {
      this.opener= false;
    },
    //取消
    cancelfr() {
      this.openfr= false;
    },
    //取消
    cancelers() {
      this.opentd= false;
    },
    //删除
    shanchu(){
      this.delqueryParams.handBrand=this.$route.query.handBrander;
      if (this.delqueryParams.handBrand==null)
      {
        console.log('bbbbbb')
      }
      else {
        this.delqueryParams.currentGuest=1;
        listNumber(this.delqueryParams).then(response => {
          this.numberList5 = response.rows;

          // this.form2=this.numberList5[0]
          this.numberList5[0].currentGuest = 2;
          updateNumber(this.numberList5[0]).then(response => {
            this.getList1();
            this.getList2();
            this.getList3();
          });
        });
      }


    },
    submitFormfr(){
      console.log("1234"+this.update);
      getNumber(this.update).then(response => {
        this.form4 = response.data;
        console.log("12345"+this.form4);
        this.form4.currentGuest=2;
        console.log("123456"+this.form4.currentGuest);
        updateNumber(this.form4).then(response => {
            this.getList1();
            this.getList2();
          this.getList3();
            this.openfr=false;
          });
      });

    },
    // 提交按钮
    submitForm() {
      this.queryParams.currentGuest=1;
      this.queryParams.handBrand=this.form.handBrand;
      this.queryParams.nextGuest=null;
      this.queryParams.note1=null;
      if (this.queryParams.handBrand==null||this.queryParams.handBrand=='')
      {
        this.$modal.msgError("请输入手牌号");
      }
      else {
        listNumber(this.queryParams).then(response => {
          this.numberList5 = response.rows;
          // this.form2=this.numberList5[0]
          if (this.numberList5.length==0)
          {
            console.log(this.numberList5[0].handBrand)
            this.$modal.msgError("此手牌号不能进行操作");
          }
          else {
            // this.numberList5[0].currentGuest = 2;
            // updateNumber(this.numberList5[0]).then(response => {
            this.$router.push({path:'/cuozao/dian',query:{handBrand:this.form.handBrand}});
            // });
          }
        });
        this.open = false;
      }

    },
// 表格隔行变色
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 === 0) {
        return 'success-row' //这是类名
      } else  {
        return ''
      }
    },
    //录入按钮
    ceshi(){
      this.open = true;
    },
    //录入按钮
    handleAdd() {
      this.handqueryParams.handBrand=this.form.handBrand;
      if (this.handqueryParams.handBrand==null||this.handqueryParams.handBrand=='')
      {
        this.$modal.msgError("请输入手牌号");
      }
      else {
        this.billqueryParams.handBrand=this.form.handBrand;
        this.billqueryParams.handState=1
        listBills(this.billqueryParams).then(response => {
          this.billsList = response.rows;
          if (this.billsList.length==0)
          {
            this.$modal.msgError("此手牌未开牌");
          }
          else {
            this.queryParams1.handBrand=this.handqueryParams.handBrand
            this.queryParams1.currentGuest=0;
            listNumber(this.queryParams1).then(response => {
              this.numberList3 = response.rows;
              if (this.numberList3.length==1)
              {
                this.$modal.msgError("此手牌号正在排号中");
              }
              else {
                this.queryParams1.handBrand=this.handqueryParams.handBrand
                this.queryParams1.currentGuest=1;
                listNumber(this.queryParams1).then(response => {
                  this.numberList4 = response.rows;
                  if (this.numberList4.length==1)
                  {
                    this.$modal.msgError("此手牌号正在服务中");
                  }
                  else {
                    listHands(this.handqueryParams).then(response => {
                      this.handsList = response.rows;
                      if (this.handsList[0].lockedState==0)
                      {
                        this.$modal.msgError("此手牌号已被锁定");
                      }

                      else {
                        if (this.form.note1==1&&this.form.nextGuest=="无")
                        {
                          this.$modal.msgError("请选择技师");
                        }
                        else{
                          if (this.form.note1==0)
                          {
                            this.form.currentGuest=0;
                            this.form.startNumberingTime=this.currentTime();
                            this.form.nextGuest="无"
                            addNumber(this.form).then(response => {
                              this.form.handBrand=null;
                              this.form.nextGuest='无'
                              this.getList1();
                              this.getList2();
                              this.getList3();
                              this.open = false;
                            });
                          }
                          else {
                            this.form.currentGuest=0;
                            this.form.startNumberingTime=this.currentTime();
                            addNumber(this.form).then(response => {
                              this.form.handBrand=null;
                              this.form.nextGuest='无'
                              this.form.note1=0;
                              this.getList1();
                              this.getList2();
                              this.getList3();
                              this.open = false;
                            });
                          }

                        }

                      }
                    });

                  }
                });
              }
            });


          }
        });

      }

    },

    // 添加商品不进库操作
    handleAddgong(id) {
      getBaseinfo(id).then(response => {
        this.List1 = response.data;
        this.form.nextGuest = this.List1.userName;
console.log("11111"+this.List1.userName)
console.log("22222"+this.form.nextGuest)
      })
    },
    /** 查询技师信息列表 */
    getProjectList1(){
      this.loading = true;
      listProject(this.projectinformations).then(response => {
        this.goodsList = response.rows;
        this.getRow();
        this.total = response.total;
        this.loading = false;
      });
    },
// 分包函数
    getRow () {
      let arr = [];
      let row = Math.ceil(this.baseinfonumberList.length / 4);
      //  行循环
      for (let i = 0; i < row; i++) {
        //  第i行的商品
        arr[i] = [];
        // modLast：最后一行的商品个数
        let modLast = this.baseinfonumberList.length % 4 === 0 ? 4 : this.baseinfonumberList.length % 4;
        // lastRow：判断当前循环是不是最后一行，是就让内层循环最后一行的商品个数，不是则默认5个
        let lastRow = i === (row - 1) ? modLast : 4;
        //  列循环
        for (let j = 0; j < lastRow; j++) {
          arr[i][j] = this.baseinfonumberList[4 * i + j];
        }
      }
      //  最后得到arr数组，将数组赋值给一个变量
      this.branchData= arr;
      console.log("1234"+this.branchData)
    },
    // 上一页
    shangyiye(){
        this.baseinfoqueryParams.pageNum -= 1;
        if (this.baseinfoqueryParams.pageNum == 0) {
          this.$modal.msgError("第一页");
          this.baseinfoqueryParams.pageNum = 1;
        }
        this.getusername();
    },

    // 下一页
    xiayiye(){


        this.baseinfoqueryParams.pageNum+=1;
        if(this.baseinfoqueryParams.pageNum==3){
          this.$modal.msgError("最后一页了！");
          this.baseinfoqueryParams.pageNum=3;
        }
        this.getusername();


    },
    //呼叫
    handleUpdate(){
          this.queryParams.currentGuest=0;
          this.queryParams.note1=0;
          listNumber(this.queryParams).then(response => {
            this.numberList4 = response.rows;
            if (this.numberList4.length==0)
            {
              this.$modal.msgError("无需要服务的客人");
            }
            else {
              this.numberList4[0].currentGuest = 1;
              updateNumber(this.numberList4[0]).then(response => {
                this.getList1();
                this.getList2();
                this.getList3();
              });
            }
          });
    },
    //专呼
    zhuanhude(){
      this.queryParams.currentGuest=0;
      this.queryParams.note1=1;
      this.queryParams.nextGuest=this.form3.userId;
      if (this.queryParams.nextGuest==null||this.queryParams.nextGuest==''){
        this.$modal.msgError("请输入员工号");
      }
      else {
        listNumber(this.queryParams).then(response => {
          this.numberList4 = response.rows;
          if (this.numberList4.length==0)
          {
            this.$modal.msgError("无需要服务的客人");
          }
          else {
            this.numberList4[0].currentGuest = 1;
            updateNumber(this.numberList4[0]).then(response => {
              this.getList1();
              this.getList2();
              this.getList3();
              this.opentd= false;
            });
          }
        });
      }

    },


    handleUpdater(){
      this.opentd = true;
    },
    /**
     * 获取当前时间
     */
    currentTime() {
      var date = new Date();
      var year = date.getFullYear(); //月份从0~11，所以加一
      let month = date.getMonth();
      var dateArr = [
        date.getMonth() + 1,
        date.getDate(),
        date.getHours(),
        date.getMinutes(),
        date.getSeconds(),
      ];
      //如果格式是MM则需要此步骤，如果是M格式则此循环注释掉
      for (var i = 0; i < dateArr.length; i++) {
        if (dateArr[i] >= 1 && dateArr[i] <= 9) {
          dateArr[i] = "0" + dateArr[i];
        }
      }
      var strDate =
        year +
        "-" +
        dateArr[0] +
        "-" +
        dateArr[1] +
        " " +
        dateArr[2] +
        ":" +
        dateArr[3] +
        ":" +
        dateArr[4];
      //此处可以拿外部的变量接收  strDate:2022-05-01 13:25:30
      //this.date = strDate;
      return strDate;
    },


    //操作按钮
    handleUpdate2(){
      this.opener = true;
      // this.title = "点单";
    },

    //操作按钮
    handleUpdate1(){

      this.queryParams.currentGuest=1;
      this.queryParams.handBrand=this.form.handBrand;
      listNumber(this.queryParams).then(response => {
        this.numberList5 = response.rows;
        // this.form2=this.numberList5[0]
        if (this.numberList5.length==0)
        {
          this.$modal.msgError("此手牌号不能进行操作");
        }
        else {
          this.numberList5[0].currentGuest = 2;
          updateNumber(this.numberList5[0]).then(response => {
            this.$router.push({path:'/cuozao/dian',query:{handBrand:this.form.handBrand}});
          });
        }
      });

    }

  }
}
</script>


<style>
.fanye{
  /*display: flex;*/
  width: 200px;
  margin-left: 960px;
  margin-top: -150px;

/*background-color: #ff9700;*/
}
.shangyiye{
  width: 200px;
  height: 80px;
  margin-bottom: 30px;
  font-size: 24px;
}
.xiayiye{
  width: 200px;
  height: 80px;
  font-size: 24px;

}
.put{
  /*display: flex;*/
  width: 900px;
  margin-top: 50px;
  margin-left: -100px;
  /*background-color: #30B08F;*/
}
.put0{
  display: flex;
  height: 760px;

}
.put1{
  display: flex;
  height: 760px;
margin-top: -20px;
margin-left: -220px;
}
.put2{
  display: flex;
  height: 760px;
}
.put3{
  height: 800px;
}
.zhuanhu{
  margin-left: 330px;
  /*margin-bottom: 100px;*/
}
.zhuanhuanniu{
  margin-left: -140px;
  margin-top: -10px;
  width: 200px;
  height: 80px;
  font-size: 24px;
}
.diandan1{
  margin-left: 330px;
  /*margin-bottom: 100px;*/
}
.luru1{
  margin-left: 300px;
}
.leixing{
  margin-left: 1000px;
  margin-top: -100px;
  height: 60px;
  width: 500px
}
.tiaoweizhi{
  /*margin-left: -170px;*/
  /*background-color: #ff9700;*/
}
.shounum{
  width: 30%;
  margin-top: 2%;
  margin-left: 4%;
}

.gebo{
  width: 70%;
  font-size: 32px;
}
.yuannum{
  width: 30%;
  margin-top: 2%;
  margin-left: 2%;
}
.yuan{
  width: 73%;
}
.anniu{
  display: flex;
}
.luru{
  width: 30%;
  margin-left: 4.5%;
  margin-top: 60px;
}
.diandan{
  width: 30%;
  margin-left: 2%;
  margin-top: 60px;
}
.hujiao{
  width: 30%;
  margin-left: 2%;
  margin-top: 60px;
}
.query{
  width: 97%;
  height: 60px;
  font-size: 32px;
  background-color: #dd514c;
}
.query100{

}
.query1{
  width: 97%;
  height: 60px;
  font-size: 32px;
  background-color: #00afff;
}
.call{
  width: 48%;
  height: 60px;
  font-size: 32px;
  background-color: #4cd964;
}
.tanchu{
  margin-top: 50px;
  height: 200px;
}
.tou{
  margin-top: 5%;
  height: 40%;
}
.jiao{
  height: 60%;
}
.queding{
  width: 120px;
  height: 60px;
  font-size: 32px;
  background-color: #00afff;
  margin-left: 100px;
  margin-right: 400px;
}
.quxiao{
  width: 120px;
  height: 60px;
  font-size: 32px;
  background-color: #00afff;
}
.queding1{
  width: 120px;
  height: 60px;
  font-size: 32px;
  background-color: #00afff;
  margin-left: 140px;
  margin-right: 350px;
  /*margin-top: 50px;*/
}
.quxiao1{
  width: 120px;
  height: 60px;
  font-size: 32px;
  margin-left: 670px;
  background-color: #00afff;
  /*margin-top: 50px;*/
}
.queding2{
  width: 120px;
  height: 60px;
  font-size: 32px;
  background-color: #00afff;
  margin-left: 190px;
  margin-right: 250px;
}
.quxiao2{
  width: 120px;
  height: 60px;
  font-size: 32px;
  background-color: #00afff;
}
.big_box{
  display: flex;
  height: 800px;
  margin-top: 1%;
}
.zuo_box{
  width: 30%;
  height: 700px;
  margin-left: 3%;
  margin-top: 5%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
}
.left{
  color: #dd514c;

}
.zhong_box {
  width: 30%;
  height: 700px;
  margin-left: 3%;
  margin-top: 5%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
}
.center{
  color: #00afff;
}
.you_box{
  width: 30%;
  height: 700px;
  margin-left: 3%;
  margin-top: 5%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
}
.right{
  color: #4cd964;
}
.bbb{
  margin-top: 15.9%;
  text-align: center;
}
.ddd{
  margin-top: -23px;
  font-size: 24px;
  width: 100%;
}
.my-label {
  font-size: 32px;
}
.my-label1 {
  margin-right: 52px;
  font-size: 32px;
}
.woxiangjuzhong{
  margin-right: 100px;
  text-align: center;
}
.el-table--striped tbody>tr:nth-child(odd) {
  background-color: #d2f1f0;
}
.el-radio-group_label{
  font-size: 32px;
}
.aaa{
  margin-left: 32px;
  margin-top: -20px;

}

.num{
  position: relative;
  left: -315px;
  right: -100px;
  top: -30px;
}
.num2{
  position: relative;
  left: -530px;
  right: -100px;
  top: -20px;
}

.no-border .el-input__inner {
  border: none;
}
.el-radio /deep/ .el-radio__label {
  font-size: 20px !important;
}
.button-list {
  text-align: center;
}
.ai-tab-change
.el-radio-button__inner {
  width: 200px;
  height: 60px;
  vertical-align: middle;
  border-radius: 4px 0px 0px 4px;
  border: 1px solid #D8DCE6;
  text-align: center;
  font-size: 36px;
  font-weight: 400;
  color: #696969;
  line-height: 40px;
  outline: none;
  box-shadow: none;
}
.el-radio-button__orig-radio:checked + .el-radio-button__inner {
  background: #E6ECF2;
  border: 1px solid #98B5CA;
  color: #0D4376;
  line-height: 40px;
  outline: none;
  box-shadow: none;
}


.button1{
  font-size: 32px;
  border: 3px solid #9c26b0;
}
.el-dialog-div{
  height: 130vh;
  overflow: auto;
}
.lyqcard{
  width: 100%;
  margin-top: -40px;
}

</style>
